TEGetPoint
TEGetPoint Obtain screen coordinates of an edit record character
#include <TextEdit.h> TextEdit
long TEGetPoint(theOffset, hTE );
short theOffset; offset in TERec.hText of character of interest
TEHandle hTE; handle of an edit record
returns hi word is vertical, lo word is horizontal
The TEGetPoint function returns the point corresponding to the given offset
into the specified text. This point indicates the bottom left of the character at
the specified offset.
theOffset is an offset within the data led to by the hText field of hTE. This
identifies a particular character (or start of a sequence of
characters) in the edit record.
hTE is a handle to the edit record. The offset parameter indicates a
position in the text that is specified by hTE.
With this version of TextEdit, the TEGetPoint function returns a valid
result even when no text is in the edit record. The point returned is based on
the values in the record's destination rectangle. The line height, taken either
from the lineHeight field for an unstyled edit record or from the line-height
element array for a styled edit record, is also used to determine the vertical
component. Both the line and system alignments (teJust and TESysJust) are
used to determine the horizontal component.
In the case of the offset equal to a line end (which is also the line start of the
next line), TEGetPoint returns a point corresponding to the line start of the
next line. For example, as shown in the following figure, if the offset 3 is
passed to TEGetPoint, the point returned corresponds to the offset 3 before
the character d on the second line. In the case of a mixed- directional line, the
primary caret position (the one corresponding to the line direction) is
returned. See Mixed-Directional Text for details on primary caret positions in
a line containing mixed- directional text.
A character offset at a line break
Returns: an 32-bit long integer identifying a screen point, in local
coordinates. The hi word is the vertical coordinate and the low word
is the horizontal coordinate. Note that IM incorrectly refers to this
as a non-existent POINT data type. The return value can be coerced
into a Point via type casting.

Notes: TEGetPoint lets you find the screen position of a particular
character in an edit record. Used in conjunction with TEGetOffset, you
use this function to perform manually (and quickly) some operations that
might be otherwise impossible or very slow. TEGetPoint works for
old-format as well as new-format edit records.
Use TEGetOffset for the inverse operation (determine which character is
associated with a screen point).